package com.base.action;

import com.common.bean.Department;
import com.common.util.PagerModel;
//import com.opensymphony.xwork2.Preparable;

public class UpdateDepartmentAction extends AbstractDepartmentAction  {
	private static final long serialVersionUID = 1L;

	private Department department;
	
	private String deptcode;
	
	private PagerModel pm;
	
	@Override
	public String execute() throws Exception {
		department = (Department)departmentService.findDepartment(deptcode);
		
		pm = departmentService.findAllDept(deptcode);
		return SUCCESS;
	}

	public String doUpdate() {
		departmentService.updateDepartment(department);
		return SUCCESS;
	}
	
	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	public String getDeptcode() {
		return deptcode;
	}

	public void setDeptcode(String deptcode) {
		this.deptcode = deptcode;
	}

	public PagerModel getPm() {
		return pm;
	}

	public void setPm(PagerModel pm) {
		this.pm = pm;
	}
}
